/*  
 * Video Game Network Library
 * http://gamenetlib.codeplex.com/
 * 
 * Copyright (c) 2011 Joe Hegarty
 *  
 * This source code is subject to the terms of the Microsoft Public License (Ms-PL). 
 *  
 * Redistribution and use in source and binary forms, with or without modification, 
 * is permitted provided that redistributions of the source code retain the above 
 * copyright notices and this file header. 
 * 
 * For details, see <http://www.opensource.org/licenses/ms-pl.html>. 
 *  
 * All other rights reserved. 
 *
 */  

#ifndef __NET_LIB_SOCKET_ADDRESS_HPP__
#define __NET_LIB_SOCKET_ADDRESS_HPP__

#include "PublicIncludes.hpp"
#include <string>

namespace NNetLib
{

	class CSocketAddress
	{
	public:
		CSocketAddress();
		CSocketAddress(u32 address, u16 port);
		CSocketAddress(const std::string& address, u16 port);

		bool operator ==(const CSocketAddress& rhs) const;

		u32 GetAddress() const { return m_address; }
		u16 GetPort() const { return m_port; }
		void SetAddress(u32 address) { m_address = address; }
		void SetPort(u16 port) { m_port = port; }

		static u32 CreateAddress(u8 a, u8 b, u8 c, u8 d);

	private:
		u32 m_address;
		u16 m_port;
	
	};

}

#endif // __NET_LIB_SOCKET_ADDRESS_HPP__